/****************************************************************************
*                                                                           *
* property.h 																*	
*                                                                           *
* ALaRI 2008												                *
*                                                                           *
****************************************************************************/

#pragma once

#if !defined(__PROPERTY_H)
#define __PROPERTY_H

/****************************************************************************
* Includes										                            *
****************************************************************************/
#include <QObject>

#include "defs.h"
#include "singleton.h"

class CSimProperty : 
	public QObject,
	public CSingleton<CSimProperty>
{
	Q_OBJECT

	Q_PROPERTY(float frequency READ getFrequency WRITE setFrequency)
	Q_PROPERTY(int resolution READ getResolution WRITE setResolution)
	Q_PROPERTY(int outputPower READ getOutputPower WRITE setOutputPower)
	Q_PROPERTY(int sensitivity READ getSensitivity WRITE setSensitivity)

	friend class CSingleton<CSimProperty>;

public :
	static CSimProperty* inst() 
		{ return (dynamic_cast<CSimProperty*>(getInstance())); } 
	inline void setFrequency(float fltFreq) { m_fltFreq = fltFreq; }
	inline float getFrequency() const { return m_fltFreq; }
	inline void setResolution(int nResolution) { m_nResolution = nResolution; }
	int getResolution() const { return m_nResolution; }
	void setSensitivity(int nSensitivity) { m_nSensitivity = nSensitivity; }
	int getSensitivity() const { return m_nSensitivity; }

	void setOutputPower(int nOutputPower) { m_nOutputPower = nOutputPower; }
	int getOutputPower() const { return m_nOutputPower; }

protected :
	CSimProperty()
	{
		// det default frequency, 2.4 GHz
		setFrequency(2.4f);
		// set default resolution 2 cm
		setResolution(2);
		// set default sensitivity
		setSensitivity(0);
		// set default output power to 0 dBm
		setOutputPower(0);

	}
	~CSimProperty()
	{}

private :
	float m_fltFreq;
	int m_nResolution;
	int m_nSensitivity;
	int m_nOutputPower;
};

#endif /* __PROPERTY_H */
/****************************************************************************
* End of file																*
****************************************************************************/

